package com.k.ssh.cloud.k8s.config.controller;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

@RestController
@Slf4j
//@Data
@RefreshScope
public class HelloControl {
    @Value("${config.applicationVersion:}")
    private String applicationVersion;
    @Value("${blog:}")
    private String blogName;
    @GetMapping("/index")
    public String get() {
        log.info("{}", blogName);
        return "ConfigController#get blog name = " + blogName;
    }
    @PostConstruct
    private void init(){
        log.info("HelloControl:applicationVersion---{}", applicationVersion);
        log.info("HelloControl:blogName---{}", blogName);
    }
}
